CMAKE_MINIMUM_REQUIRED (VERSION 3.1)
PROJECT (mofem)

SET(EXECUTABLE_NAME mofem)
SET (${EXECUTABLE_NAME}_VERSION_MAJOR 0)
SET (${EXECUTABLE_NAME}_VERSION_MINOR 2)
  
# Sources
INCLUDE(CMakeSrcs.txt)

# Find Boost
# Make sure BOOST_ROOT environment variable is set
FIND_PACKAGE(Boost 1.5.7 REQUIRED)
IF(Boost_FOUND)
  INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIRS})
ENDIF()

# Find Eigen
SET(EIGEN_ROOT $ENV{EIGEN_ROOT} CACHE PATH "Eigen root directory")
INCLUDE_DIRECTORIES(${EIGEN_ROOT})

INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/src)

# Build types
UNSET(CMAKE_CONFIGURATION_TYPES CACHE)
SET(CMAKE_CONFIGURATION_TYPES "Debug;Release" CACHE STRING "Supported config types")

# No install
UNSET(CMAKE_INSTALL_PREFIX CACHE)

# Preproccessor 
ADD_DEFINITIONS(-DEIGEN_DEFAULT_TO_ROW_MAJOR)

# Executable
ADD_EXECUTABLE(${EXECUTABLE_NAME} ${SRC_ALL})

# Source Groups
INCLUDE(CMakeSrcGroups.txt)